Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added diesel::r2d2::TestCustomizer #4186

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Conversation

kpagacz
Copy link
Contributor

@kpagacz kpagacz commented Aug 19, 2024

Closes #4152

Let me know if you need me to make any improvements. I am unsure about the Error mapping. The problem I solved there was:

  • the Pool::builder requires a connection customizer's error to be ConnectionManager::Error, which is diesel::r2d2::Error
  • the return value from begin_test_transaction() is QueryResult, which error is diesel::result::Error

Hence the mapping, but I wonder if this is even correct for diesel. Let me know if you need me to make any adjustments here and with the docs!

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

I think the error mapping is fine, we somewhat need to return the error there and that looks like a reasonable way.

The documentation looks fine for me.

@weiznich weiznich added this pull request to the merge queue Aug 23, 2024
Merged via the queue into diesel-rs:master with commit 8602ef3 Aug 23, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a r2d2::CustomizeConnection for testing
2 participants